package com.xiyang.cjtool.cj.core;

import com.xiyang.cjtool.cj.annotation.FXMLController;
import com.xiyang.cjtool.cj.support.FXMLConverter;
import javafx.fxml.FXMLLoader;

import java.net.URL;

/**
 * @author xiyang.ycj
 * @since Sep 10, 2020 14:53:12 PM
 */
public abstract class AbstractFXMLController {

    private final FXMLController annotation;
    private final URL resource;
    private final FXMLLoader loader;

    public AbstractFXMLController() {
        // TODO: 2020/9/10  将来 换成单例 或者 ioc di
        FXMLConverter converter = new FXMLConverter();
        annotation = converter.getFXMLAnnotation(this.getClass());
        resource = converter.getURLResource(annotation,this.getClass());
        System.out.println(annotation.view());
        System.out.println(resource);
        loader = new FXMLLoader();
    }

}
